import request from '@/utils/request'

// 登录(获取Toekn)

export async function login(data) {
  return request({
    url: '/connect/token',
    method: 'post',
    data: data,
  })
}

export function getUserInfo() {
  //此处为了兼容mock.js使用data传递accessToken，如果使用mock可以走headers
  return request({
    url: '/api/identity/my-profile',
    method: 'get',
    needToken: true,
  })
}

export function register() {
  return request({
    url: '/register',
    method: 'post',
  })
}
